TEST_FILES=`ls tests/`

for file in ${TEST_FILES}; do
	if [ -f out ]; then
		rm out
	fi
	touch out
	auto-dep -I. tests/${file} > out
	if [ ! -f valid/${file}.control ]; then
		echo "Missing valid file for ${file}"
	else
		differences=`diff out valid/${file}.control`
		if [ ${#differences} -gt 0 ]; then
			echo "Invalidation in $file"
			echo ""
			echo ${differences}
			echo ""
			exit
		else
			echo "${file} Passed"
		fi
	fi
	rm out
done

touch out
auto-dep -I. multi_tests/multi.c > out
if [ ! -f valid/multi.control ]; then
	echo "Missing valid file for multi test"
else
	differences=`diff out valid/multi.control`
	if [ ${#differences} -gt 0 ]; then
		echo "Invalidation in multi test"
		echo ""
		echo ${differences}
		echo ""
		exit
	else
		echo "multi Passed"
	fi
fi
rm out
